var richEditor = function() {
	this.editor = null;

};

richEditor.prototype.create = function(userOption) {
	this.editor = new wangEditor(userOption.domId);
	this.editor.config.uploadImgUrl = userOption.imageUploadUrl;
	this.editor.config.uploadImgFileName = userOption.uploadImgFileName;
	this.editor.config.menus = [
		'source',
		'|',
		'bold',
		'underline',
		'italic',
		'strikethrough',
		'eraser',
		'forecolor',
		'bgcolor',
		'|',
		'quote',
		'fontfamily',
		'fontsize',
		'head',
		'unorderlist',
		'orderlist',
		'alignleft',
		'aligncenter',
		'alignright',
		'|',
		'table',
		'|',
		'img',
		'|',
		'undo',
		'redo',
		'fullscreen'
	];
	// 隐藏掉插入网络图片功能。该配置，只有在你正确配置了图片上传功能之后才可用。
	this.editor.config.hideLinkImg = true;
	this.editor.create();
};
richEditor.prototype.getHtml = function(){
	return this.editor.$txt.html();
};

module.exports = richEditor;